//
//  HttpSessionManager.h
//  Traveling
//
//  Created by huju on 16/7/19.
//  Copyright © 2016年 zzz. All rights reserved.
//

#import "AFHTTPSessionManager.h"

// .h文件
#define SingletonH + (instancetype)sharedInstance;

// .m文件
#define SingletonM \
static id _instance; \
\
+ (id)allocWithZone:(struct _NSZone *)zone \
{ \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
_instance = [super allocWithZone:zone]; \
}); \
return _instance; \
} \
\
+ (instancetype)sharedInstance \
{ \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
_instance = [[self alloc] init]; \
}); \
return _instance; \
} \
\
- (id)copyWithZone:(NSZone *)zone \
{ \
return _instance; \
}

@interface HttpSessionManager : AFHTTPSessionManager
SingletonH;
@end
